const { Service } = require("egg");

class TypeService extends Service {
    async list() {
        const { ctx, app } = this;
        const QUERY_STR = 'id,name,type'
        let sql =  `select ${QUERY_STR} from type`
        try {
            const result = await app.mysql.query(sql)
            return result
        } catch(err) {
            console.log(err)
            return null
        }
    }
}

module.exports = TypeService